package com.bby.user.pojo;

import cn.hutool.core.util.ObjectUtil;
import com.bby.common.utils.R;

public class ServiceResult {
    public static int CODE_NOT_FIND = 1;
    public static int CODE_OK = 0;
    public static int CODE_ALREADY_EXISTED = 2;
    int code;
    String userId;
    String msg;
    Object data;

    public boolean isOK(){
        return CODE_OK == code;
    }
    public void setCode(int code) {
        this.code = code;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public String getUserId() {
        return userId;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }
    public R getR() {
        R r = new R().setCode(code).setMsg(msg).setData(data);
        return r;
    }
}
